home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Dictionary.p < prev    next >
Text File  |  1996-05-01  |  22KB  |  466 lines

  1. {
  2.      File:        Dictionary.p
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Dictionary;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DICTIONARY__}
  28. {$SETC __DICTIONARY__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DictionaryIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  38. {$IFC UNDEFINED __AEDATAMODEL__}
  39. {$I AEDataModel.p}
  40. {$ENDC}
  41. {$IFC UNDEFINED __AEREGISTRY__}
  42. {$I AERegistry.p}
  43. {$ENDC}
  44. {$IFC UNDEFINED __FILEMANAGERTYPES__}
  45. {$I FileManagerTypes.p}
  46. {$ENDC}
  47. {$ENDC}
  48. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  49. {$IFC UNDEFINED __FILES__}
  50. {$I Files.p}
  51. {$ENDC}
  52. {$ENDC}
  53.  
  54. {$PUSH}
  55. {$ALIGN POWER}
  56. {$LibExport+}
  57.  
  58. {
  59. =============================================================================================
  60.  System 8 Dictionary Manager
  61. =============================================================================================
  62. }
  63. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  64.  
  65. TYPE
  66.     DCMUniqueID                            = UInt32;
  67. {$IFC FOR_PTR_BASED_AE }
  68.     DCMFieldDataList                    = AERecord;
  69.     DCMFieldDataListPtr                 = ^DCMFieldDataList;
  70. {$ENDC}
  71.     DCMObjectID = ^LONGINT;
  72.     DCMAccessMethodID                    = DCMObjectID;
  73.     DCMDictionaryID                        = DCMObjectID;
  74.  
  75. CONST
  76.     kDCMInvalidObjectID            = 0;
  77.  
  78.  
  79. TYPE
  80.     DCMObjectRef = ^LONGINT;
  81.     DCMDictionaryRef                    = DCMObjectRef;
  82.     DCMDictionaryStreamRef                = DCMObjectRef;
  83.     DCMFieldInfoRef                        = DCMObjectRef;
  84.  
  85. CONST
  86.     kDCMInvalidObjectRef        = 0;
  87.  
  88.  
  89. TYPE
  90.     DCMObjectIterator = ^LONGINT;
  91.     DCMAccessMethodIterator                = DCMObjectIterator;
  92.     DCMDictionaryIterator                = DCMObjectIterator;
  93.     DCMFoundRecordIterator = ^LONGINT;
  94. {
  95.     Field specification declarations
  96. }
  97.     DCMFieldTag                            = FourCharCode;
  98.     DCMFieldType                        = FourCharCode;
  99.     DCMFieldSubType                        = UInt64;
  100.     DCMFieldSubTypePtr                     = ^DCMFieldSubType;
  101.  
  102. CONST
  103.     kDCMAnyFieldTag                = '****';
  104.     kDCMAnyFieldType            = '****';
  105.  
  106. {
  107.     Dictionary information
  108. }
  109.     kDCMDictionaryHeaderVersion    = 1;
  110.  
  111.  
  112. TYPE
  113.     DCMDictionaryHeaderPtr = ^DCMDictionaryHeader;
  114.     DCMDictionaryHeader = RECORD
  115.         headerSignature:        FourCharCode;
  116.         headerVersion:            UInt32;
  117.         headerSize:                ByteCount;
  118.         accessMethod:            Str63;
  119.     END;
  120.  
  121.     DCMFieldAttribute                    = OptionBits;
  122.  
  123. CONST
  124.     kDCMIndexedFieldMask        = $00000001;
  125.     kDCMRequiredFieldMask        = $00000002;
  126.     kDCMIdentifyFieldMask        = $00000004;
  127.     kDCMFixedSizeFieldMask        = $00000008;
  128.     kDCMHiddenFieldMask            = $80000000;
  129.  
  130. {
  131.     Standard dictionary properties
  132. }
  133.                                                                 {  created/updated by AccessMethod. }
  134.                                                                 {  data type: typeSInt16 }
  135.     kDCMPermissionPropertyTag    = 'perm';                        {  created/updated by AccessMethod. }
  136.                                                                 {  data type: typeSInt16 }
  137.     kDCMMaintenancePropertyTag    = 'mtnc';                        {  created by AccessMethod. default = kLocaleIdentifierWildCard. }
  138.                                                                 {  data type: typeUInt32 }
  139.     kDCMLocalePropertyTag        = 'locl';                        {  optional. }
  140.                                                                 {  data type: typeType }
  141.     kDCMClassPropertyTag        = 'clas';                        {  optional. }
  142.                                                                 {  data type: typeChar (ASCII string) }
  143.     kDCMCopyrightPropertyTag    = 'info';
  144.  
  145. {
  146.     'perm' property constants
  147. }
  148.     kDCMReadOnlyDictionary        = 0;
  149.     kDCMReadWriteDictionary        = 1;
  150.     kDCMFrozenDictionary        = 2;
  151.  
  152. {
  153.     Standard search method
  154. }
  155.  
  156. TYPE
  157.     DCMFindMethodType                    = OSType;
  158.  
  159. CONST
  160.     kDCMExactMatchMethod        = '=   ';
  161.     kDCMBeginningMatchMethod    = 'bgwt';
  162.     kDCMContainsMatchMethod        = 'cont';
  163.     kDCMEndingMatchMethod        = 'ends';
  164.     kDCMForwardTrieMethod        = 'ftri';                        {  used for morphological analysis }
  165.     kDCMBackwardTrieMethod        = 'btri';                        {  used for morphological analysis }
  166.  
  167. {
  168.     AccessMethod features
  169. }
  170.  
  171. TYPE
  172.     DCMAccessMethodFeature                = OptionBits;
  173.  
  174. CONST
  175.     kDCMCanUseFileDictionaryMask = $00000001;
  176.     kDCMCanUseMemoryDictionaryMask = $00000002;
  177.     kDCMCanStreamDictionaryMask    = $00000004;
  178.     kDCMCanHaveMultipleIndexMask = $00000008;
  179.     kDCMCanModifyDictionaryMask    = $00000010;
  180.     kDCMCanCreateDictionaryMask    = $00000020;
  181.     kDCMCanAddDictionaryFieldMask = $00000040;
  182.     kDCMCanUseTransactionMask    = $00000080;
  183.  
  184. {
  185.     Error values
  186. }
  187.     dcmParamErr                    = -7100;                        {  bad parameter }
  188.     dcmNotDictionaryErr            = -7101;                        {  not dictionary }
  189.     dcmBadDictionaryErr            = -7102;                        {  invalid dictionary }
  190.     dcmPermissionErr            = -7103;                        {  invalid permission }
  191.     dcmDictionaryNotOpenErr        = -7104;                        {  dictionary not opened }
  192.     dcmDictionaryBusyErr        = -7105;                        {  dictionary is busy }
  193.     dcmBadDictionaryTypeErr        = -7106;                        {  bad dictionary type }
  194.     dcmBlockFullErr                = -7107;                        {  dictionary block full }
  195.     dcmNoRecordErr                = -7108;                        {  no such record }
  196.     dcmDupRecordErr                = -7109;                        {  same record already exist }
  197.     dcmNecessaryFieldErr        = -7110;                        {  lack required/identify field }
  198.     dcmBadFieldInfoErr            = -7111;                        {  incomplete information }
  199.     dcmBadFieldTypeErr            = -7112;                        {  no such field type supported }
  200.     dcmNoFieldErr                = -7113;                        {  no such field exist }
  201.     dcmDupFieldErr                = -7114;                        {  field already exist }
  202.     dcmBadKeyErr                = -7115;                        {  bad key information }
  203.     dcmTooManyKeyErr            = -7116;                        {  too many key field }
  204.     dcmBadDataSizeErr            = -7117;                        {  too big data size }
  205.     dcmBadFindMethodErr            = -7118;                        {  no such find method supported }
  206.     dcmBadPropertyErr            = -7119;                        {  no such property exist }
  207.     dcmEndOfStreamErr            = -7120;                        {  reaches end of stream }
  208.     dcmProtectedErr                = -7121;                        {  need keyword to use dictionary }
  209.     dcmNoAccessMethodErr        = -7122;                        {  no such AccessMethod }
  210.     dcmDupAccessMethodErr        = -7123;                        {  AccessMethod already exist }
  211.     dcmBadFeatureErr            = -7124;                        {  invalid AccessMethod feature }
  212.     dcmAccessMethodBusyErr        = -7125;                        {  AccessMethod is busy }
  213.     dcmIterationCompleteErr        = -7126;                        {  no more item in iterator }
  214.     dcmBufferOverflowErr        = -7127;                        {  data is larger than buffer size }
  215.     dcmChangesCommittedErr        = -7128;                        {  changes cannot be backed out }
  216.  
  217. {
  218.     Callback routines
  219. }
  220.  
  221. TYPE
  222.     DCMRegisterStreamProc = ProcPtr;  { FUNCTION DCMRegisterStreamProc(refcon: UNIV Ptr; maxSize: ByteCount; VAR actualSize: ByteCount; buffer: LogicalAddress): OSStatus; C; }
  223.  
  224.     DCMProgressProc = ProcPtr;  { FUNCTION DCMProgressProc(refcon: UNIV Ptr; determinateProcess: BOOLEAN; percentageComplete: UInt16): BOOLEAN; C; }
  225.  
  226. {
  227.     Create dictionary
  228. }
  229. FUNCTION DCMNewDictionary(accessMethod: DCMAccessMethodID; containerRef: FSObjectRef; dictionaryName: ConstFSName; numOfField: ItemCount; {CONST}VAR field: DCMFieldInfoRef; invisible: BOOLEAN; recordCapacity: ItemCount; VAR newDictionary: DCMDictionaryID): OSStatus; C;
  230. FUNCTION DCMDeriveNewDictionary(srcDictionary: DCMDictionaryID; containerRef: FSObjectRef; dictionaryName: ConstFSName; invisible: BOOLEAN; recordCapacity: ItemCount; VAR newDictionary: DCMDictionaryID): OSStatus; C;
  231. {
  232.     Register dictionary
  233. }
  234. FUNCTION DCMRegisterDictionaryFile(dictionaryFile: FSObjectRef; VAR dictionaryID: DCMDictionaryID): OSStatus; C;
  235. FUNCTION DCMRegisterDictionaryStream(myRegisterProc: DCMRegisterStreamProc; refcon: UNIV Ptr; dictionarySize: ByteCount; VAR dictionaryID: DCMDictionaryID): OSStatus; C;
  236. FUNCTION DCMUnregisterDictionary(dictionaryID: DCMDictionaryID): OSStatus; C;
  237. {
  238.     Open dictionary
  239. }
  240. FUNCTION DCMOpenDictionary(dictionaryID: DCMDictionaryID; protectKeySize: ByteCount; protectKey: LogicalAddress; VAR dictionaryRef: DCMDictionaryRef): OSStatus; C;
  241. FUNCTION DCMCloseDictionary(dictionaryRef: DCMDictionaryRef): OSStatus; C;
  242. {
  243.     Change access privilege
  244. }
  245. FUNCTION DCMGetDictionaryWriteAccess(dictionaryRef: DCMDictionaryRef; timeOutDuration: Duration): OSStatus; C;
  246. FUNCTION DCMReleaseDictionaryWriteAccess(dictionaryRef: DCMDictionaryRef; commitTransaction: BOOLEAN): OSStatus; C;
  247. {
  248.     Find records
  249. }
  250. FUNCTION DCMFindRecords(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; findMethod: DCMFindMethodType; preFetchedDataNum: ItemCount; VAR preFetchedData: DCMFieldTag; skipCount: ItemCount; maxRecordCount: ItemCount; VAR recordIterator: DCMFoundRecordIterator): OSStatus; C;
  251. FUNCTION DCMCountRecordIterator(recordIterator: DCMFoundRecordIterator): ItemCount; C;
  252. {$IFC FOR_PTR_BASED_AE }
  253. FUNCTION DCMIterateFoundRecord(recordIterator: DCMFoundRecordIterator; maxKeySize: ByteCount; VAR actualKeySize: ByteCount; keyData: LogicalAddress; VAR uniqueID: DCMUniqueID; VAR dataList: DCMFieldDataList): OSStatus; C;
  254. {$ENDC}
  255. FUNCTION DCMDisposeRecordIterator(recordIterator: DCMFoundRecordIterator): OSStatus; C;
  256. {
  257.     Dump dictionary
  258. }
  259. FUNCTION DCMGetNextRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; maxKeySize: ByteCount; VAR nextKeySize: ByteCount; nextKeyData: LogicalAddress; VAR nextUniqueID: DCMUniqueID): OSStatus; C;
  260. FUNCTION DCMGetPrevRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; maxKeySize: ByteCount; VAR prevKeySize: ByteCount; prevKeyData: LogicalAddress; VAR prevUniqueID: DCMUniqueID): OSStatus; C;
  261. FUNCTION DCMGetNthRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; serialNum: ItemCount; maxKeySize: ByteCount; VAR keySize: ByteCount; keyData: LogicalAddress; VAR uniqueID: DCMUniqueID): OSStatus; C;
  262. FUNCTION DCMGetRecordSequenceNumber(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; VAR sequenceNum: ItemCount): OSStatus; C;
  263. {
  264.     Get field data
  265. }
  266. {$IFC FOR_PTR_BASED_AE }
  267. FUNCTION DCMGetFieldData(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; numOfData: ItemCount; {CONST}VAR dataTag: DCMFieldTag; VAR dataList: DCMFieldDataList): OSStatus; C;
  268. FUNCTION DCMSetFieldData(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; dataList: DCMFieldDataList): OSStatus; C;
  269. {$ENDC}
  270. FUNCTION DCMAnnotateTextObjectWithFieldData(dictionaryRef: DCMDictionaryRef; keyTag: DCMFieldTag; uniqueID: DCMUniqueID; numDataField: ItemCount; {CONST}VAR data: DCMFieldTag; keyText: TextObject): OSStatus; C;
  271. {
  272.     Add record
  273. }
  274. {$IFC FOR_PTR_BASED_AE }
  275. FUNCTION DCMAddRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; checkOnly: BOOLEAN; dataList: DCMFieldDataList; VAR newUniqueID: DCMUniqueID): OSStatus; C;
  276. {$ENDC}
  277. FUNCTION DCMDeleteRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID): OSStatus; C;
  278. FUNCTION DCMCopyRecord(srcDictionary: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; targetDictionary: DCMDictionaryRef; checkOnly: BOOLEAN; VAR newUniqueID: DCMUniqueID): OSStatus; C;
  279. {
  280.     Add field
  281. }
  282. FUNCTION DCMAddField(dictionaryID: DCMDictionaryID; fieldInfo: DCMFieldInfoRef; progressProcPtr: DCMProgressProc; procRefcon: UNIV Ptr): OSStatus; C;
  283. FUNCTION DCMDeleteField(dictionaryID: DCMDictionaryID; fieldTag: DCMFieldTag; progressProcPtr: DCMProgressProc; procRefcon: UNIV Ptr): OSStatus; C;
  284. {
  285.     Get dictionary information
  286. }
  287. FUNCTION DCMCountRecord(dictionaryID: DCMDictionaryID; VAR count: ItemCount): OSStatus; C;
  288. FUNCTION DCMGetDictionaryInformarion(dictionaryID: DCMDictionaryID; VAR accessMethod: DCMAccessMethodID; VAR isProtected: BOOLEAN): OSStatus; C;
  289. FUNCTION DCMGetDictionaryFieldList(dictionaryID: DCMDictionaryID; maxFieldNum: ItemCount; VAR actualFieldNum: ItemCount; VAR fieldTag: DCMFieldTag; VAR fieldType: DCMFieldType): OSStatus; C;
  290. FUNCTION DCMGetDictionaryFieldInfo(dictionaryID: DCMDictionaryID; fieldTag: DCMFieldTag; fieldInfo: DCMFieldInfoRef): OSStatus; C;
  291. FUNCTION DCMGetFileRefFromDictionaryID(dictionaryID: DCMDictionaryID; VAR fileRef: FSObjectRef): OSStatus; C;
  292. FUNCTION DCMGetDictionaryIDFromFile(fileRef: FSObjectRef; VAR dictionaryID: DCMDictionaryID): OSStatus; C;
  293. FUNCTION DCMGetDictionaryIDFromRef(dictionaryRef: DCMDictionaryRef): DCMDictionaryID; C;
  294. FUNCTION DCMGetDictionaryChangeCount(dictionaryID: DCMDictionaryID): UInt32; C;
  295. {
  296.     Dictionary property
  297. }
  298. FUNCTION DCMGetDictionaryProperty(dictionaryID: DCMDictionaryID; propertyTag: DCMFieldTag; maxPropertySize: ByteCount; VAR actualSize: ByteCount; propertyValue: LogicalAddress): OSStatus; C;
  299. FUNCTION DCMSetDictionaryProperty(dictionaryID: DCMDictionaryID; propertyTag: DCMFieldTag; propertySize: ByteCount; propertyValue: ConstLogicalAddress): OSStatus; C;
  300. FUNCTION DCMGetDictionaryPropertyList(dictionaryID: DCMDictionaryID; maxPropertyNum: ItemCount; VAR numProperties: ItemCount; VAR propertyTag: DCMFieldTag): OSStatus; C;
  301. {
  302.     Get dictionary stream
  303. }
  304. FUNCTION DCMCreateDictionaryStream(dictionaryID: DCMDictionaryID; VAR stream: DCMDictionaryStreamRef): OSStatus; C;
  305. FUNCTION DCMReadDictionaryStream(stream: DCMDictionaryStreamRef; maxSize: ByteCount; VAR actualSize: ByteCount; buffer: LogicalAddress): OSStatus; C;
  306. FUNCTION DCMDisposeDictionaryStream(stream: DCMDictionaryStreamRef): OSStatus; C;
  307. {
  308.     Reorganize/compact dictionary
  309. }
  310. FUNCTION DCMReorganizeDictionary(dictionaryID: DCMDictionaryID; extraCapacity: ItemCount; progressProcPtr: DCMProgressProc; procRefcon: UNIV Ptr): OSStatus; C;
  311. FUNCTION DCMFreezeDictionary(dictionaryID: DCMDictionaryID; progressProcPtr: DCMProgressProc; procRefcon: UNIV Ptr): OSStatus; C;
  312. FUNCTION DCMUnfreezeDictionary(dictionaryID: DCMDictionaryID; extraCapacity: ItemCount; progressProcPtr: DCMProgressProc; procRefcon: UNIV Ptr): OSStatus; C;
  313. {
  314.     Seaarch dictionary
  315. }
  316. FUNCTION DCMCreateDictionaryIterator(VAR dictionaryIterator: DCMDictionaryIterator): OSStatus; C;
  317. FUNCTION DCMFindDictionaryByField(desiredTag: DCMFieldTag; desiredType: DCMFieldType; attributeMask: DCMFieldAttribute; numOfFindMethod: ItemCount; {CONST}VAR neededMethods: DCMFindMethodType; requiredFieldSize: ByteCount; dataTypeTranslation: BOOLEAN; writeFieldData: BOOLEAN; findProtected: BOOLEAN; dictionaryIterator: DCMDictionaryIterator): OSStatus; C;
  318. FUNCTION DCMFindDictionaryByProperty(propertyTag: DCMFieldTag; propertySize: ByteCount; propertyValue: ConstLogicalAddress; dictionaryIterator: DCMDictionaryIterator): OSStatus; C;
  319. {
  320.     Search AccessMethod
  321. }
  322. FUNCTION DCMCreateAccessMethodIterator(VAR accessMethodIterator: DCMAccessMethodIterator): OSStatus; C;
  323. FUNCTION DCMFindAccessMethodByField(fieldType: DCMFieldType; keyField: BOOLEAN; numOfFindMethod: ItemCount; {CONST}VAR neededMethods: DCMFindMethodType; requiredSize: ByteCount; dataTypeTranslation: BOOLEAN; accessMethodIterator: DCMAccessMethodIterator): OSStatus; C;
  324. FUNCTION DCMFindAccessMethodByFeature(neededFeature: DCMAccessMethodFeature; accessMethodIterator: DCMAccessMethodIterator): OSStatus; C;
  325. {
  326.     Iterator Operation
  327. }
  328. FUNCTION DCMCountObjectIterator(iterator: DCMObjectIterator): ItemCount; C;
  329. FUNCTION DCMIterateObject(iterator: DCMObjectIterator; VAR objectID: DCMObjectID): OSStatus; C;
  330. FUNCTION DCMResetObjectIterator(iterator: DCMObjectIterator): OSStatus; C;
  331. FUNCTION DCMDisposeObjectIterator(iterator: DCMObjectIterator): OSStatus; C;
  332. {
  333.     Register AccessMethod
  334. }
  335. FUNCTION DCMRegisterAccessMethod(accessMethodFile: FSObjectRef; maxAccessMethodNum: ItemCount; VAR accessMethodNum: ItemCount; VAR accessMethod: DCMAccessMethodID): OSStatus; C;
  336. FUNCTION DCMUnregisterAccessMethod(accessMethod: DCMAccessMethodID): OSStatus; C;
  337. {
  338.     Get AccessMethod information
  339. }
  340. FUNCTION DCMGetAccessMethodInformation(accessMethod: DCMAccessMethodID; maxNameLen: ByteCount; VAR nameLength: ByteCount; libraryName: LogicalAddress; VAR version: UInt32; VAR feature: DCMAccessMethodFeature): OSStatus; C;
  341. FUNCTION DCMGetAccessMethodFieldInfoList(accessMethod: DCMAccessMethodID; maxFieldNum: ItemCount; VAR numOfField: ItemCount; VAR fieldInfo: DCMFieldInfoRef): OSStatus; C;
  342. {
  343.     Operators for DCMFieldInfoRef
  344. }
  345. FUNCTION DCMCreateFieldInfoRef(VAR fieldInfo: DCMFieldInfoRef): OSStatus; C;
  346. FUNCTION DCMDisposeFieldInfoRef(fieldInfo: DCMFieldInfoRef): OSStatus; C;
  347. FUNCTION DCMSetFieldInfoTagType(fieldInfo: DCMFieldInfoRef; fieldTag: DCMFieldTag; fieldType: DCMFieldType; {CONST}VAR subType: DCMFieldSubType): OSStatus; C;
  348. FUNCTION DCMSetFieldInfoMaxSize(fieldInfo: DCMFieldInfoRef; maximumSize: ByteCount): OSStatus; C;
  349. FUNCTION DCMSetFieldInfoAttribute(fieldInfo: DCMFieldInfoRef; attribute: DCMFieldAttribute): OSStatus; C;
  350. FUNCTION DCMSetFieldInfoName(fieldInfo: DCMFieldInfoRef; numOfName: ItemCount; {CONST}VAR fieldName: ConstTextObject): OSStatus; C;
  351. FUNCTION DCMSetFieldInfoFindType(fieldInfo: DCMFieldInfoRef; numOfType: ItemCount; VAR findMethodType: DCMFindMethodType): OSStatus; C;
  352. FUNCTION DCMSetFieldInfoFindName(fieldInfo: DCMFieldInfoRef; findMethodType: DCMFindMethodType; numOfName: ItemCount; {CONST}VAR findMethodName: ConstTextObject): OSStatus; C;
  353. FUNCTION DCMSetFieldInfoDefaultData(fieldInfo: DCMFieldInfoRef; dataSize: ByteCount; defaultData: ConstLogicalAddress): OSStatus; C;
  354. FUNCTION DCMGetFieldInfoTagType(fieldInfo: DCMFieldInfoRef; VAR fieldTag: DCMFieldTag; VAR fieldType: DCMFieldType; VAR subType: DCMFieldSubType): OSStatus; C;
  355. FUNCTION DCMGetFieldInfoMaxSize(fieldInfo: DCMFieldInfoRef; VAR maximumSize: ByteCount): OSStatus; C;
  356. FUNCTION DCMGetFieldInfoAttribute(fieldInfo: DCMFieldInfoRef; VAR attribute: DCMFieldAttribute): OSStatus; C;
  357. FUNCTION DCMGetFieldInfoName(fieldInfo: DCMFieldInfoRef; nameLocale: LocaleIdentifier; fieldName: TextObject): OSStatus; C;
  358. FUNCTION DCMGetFieldInfoNameList(fieldInfo: DCMFieldInfoRef; maxNameNum: ItemCount; VAR numOfName: ItemCount; VAR fieldName: TextObject): OSStatus; C;
  359. FUNCTION DCMGetFieldInfoFindTypeList(fieldInfo: DCMFieldInfoRef; maxMethodNum: ItemCount; VAR numOfMethod: ItemCount; VAR findMethodType: DCMFindMethodType): OSStatus; C;
  360. FUNCTION DCMGetFieldInfoFindName(fieldInfo: DCMFieldInfoRef; findMethodType: DCMFindMethodType; nameLocale: LocaleIdentifier; findMethodName: TextObject): OSStatus; C;
  361. FUNCTION DCMGetFieldInfoFindNameList(fieldInfo: DCMFieldInfoRef; findMethodType: DCMFindMethodType; maxNameNum: ItemCount; VAR numOfName: ItemCount; VAR findMethodName: TextObject): OSStatus; C;
  362. FUNCTION DCMGetFieldInfoDefaultData(fieldInfo: DCMFieldInfoRef; maxDataSize: ByteCount; VAR actualSize: ByteCount; defaultData: LogicalAddress): OSStatus; C;
  363. {
  364.     API for AccessMethod only
  365. }
  366. FUNCTION DCMAddFoundRecordToIterator(keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; VAR fieldType: DCMFieldType; VAR dataSize: ByteCount; VAR data: ConstLogicalAddress; recordIterator: DCMFoundRecordIterator): OSStatus; C;
  367. {$ENDC}
  368. {
  369. =============================================================================================
  370.  System 7 Dictionary Manager
  371. =============================================================================================
  372. }
  373. {$ALIGN MAC68K}
  374. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  375.  
  376. CONST
  377.                                                                 {  Dictionary data insertion modes  }
  378.     kInsert                        = 0;                            {  Only insert the input entry if there is nothing in the dictionary that matches the key.  }
  379.     kReplace                    = 1;                            {  Only replace the entries which match the key with the input entry.  }
  380.     kInsertOrReplace            = 2;                            {  Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry.  }
  381.  
  382. {  This Was InsertMode  }
  383.  
  384. TYPE
  385.     DictionaryDataInsertMode            = INTEGER;
  386.  
  387. CONST
  388.                                                                 {  Key attribute constants  }
  389.     kIsCaseSensitive            = $10;                            {  case sensitive = 16         }
  390.     kIsNotDiacriticalSensitive    = $20;                            {  diac not sensitive = 32     }
  391.  
  392.                                                                 {  Registered attribute type constants.     }
  393.     kNoun                        = -1;
  394.     kVerb                        = -2;
  395.     kAdjective                    = -3;
  396.     kAdverb                        = -4;
  397.  
  398. {  This Was AttributeType  }
  399.  
  400. TYPE
  401.     DictionaryEntryAttribute            = SInt8;
  402. {  Dictionary information record  }
  403.     DictionaryInformationPtr = ^DictionaryInformation;
  404.     DictionaryInformation = RECORD
  405.         dictionaryFSSpec:        FSSpec;
  406.         numberOfRecords:        SInt32;
  407.         currentGarbageSize:        SInt32;
  408.         script:                    ScriptCode;
  409.         maximumKeyLength:        SInt16;
  410.         keyAttributes:            SInt8;
  411.     END;
  412.  
  413.     DictionaryAttributeTablePtr = ^DictionaryAttributeTable;
  414.     DictionaryAttributeTable = PACKED RECORD
  415.         datSize:                UInt8;
  416.         datTable:                ARRAY [0..0] OF DictionaryEntryAttribute;
  417.     END;
  418.  
  419. FUNCTION InitializeDictionary({CONST}VAR theFsspecPtr: FSSpec; maximumKeyLength: SInt16; keyAttributes: SInt8; script: ScriptCode): OSErr;
  420.     {$IFC NOT GENERATINGCFM}
  421.     INLINE $303C, $0500, $AA53;
  422.     {$ENDC}
  423. FUNCTION OpenDictionary({CONST}VAR theFsspecPtr: FSSpec; accessPermission: SInt8; VAR dictionaryReference: SInt32): OSErr;
  424.     {$IFC NOT GENERATINGCFM}
  425.     INLINE $303C, $0501, $AA53;
  426.     {$ENDC}
  427. FUNCTION CloseDictionary(dictionaryReference: SInt32): OSErr;
  428.     {$IFC NOT GENERATINGCFM}
  429.     INLINE $303C, $0202, $AA53;
  430.     {$ENDC}
  431. FUNCTION InsertRecordToDictionary(dictionaryReference: SInt32; key: Str255; recordDataHandle: Handle; whichMode: DictionaryDataInsertMode): OSErr;
  432.     {$IFC NOT GENERATINGCFM}
  433.     INLINE $303C, $0703, $AA53;
  434.     {$ENDC}
  435. FUNCTION DeleteRecordFromDictionary(dictionaryReference: SInt32; key: Str255): OSErr;
  436.     {$IFC NOT GENERATINGCFM}
  437.     INLINE $303C, $0404, $AA53;
  438.     {$ENDC}
  439. FUNCTION FindRecordInDictionary(dictionaryReference: SInt32; key: Str255; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Handle): OSErr;
  440.     {$IFC NOT GENERATINGCFM}
  441.     INLINE $303C, $0805, $AA53;
  442.     {$ENDC}
  443. FUNCTION FindRecordByIndexInDictionary(dictionaryReference: SInt32; recordIndex: SInt32; requestedAttributeTablePointer: DictionaryAttributeTablePtr; VAR recordKey: Str255; recordDataHandle: Handle): OSErr;
  444.     {$IFC NOT GENERATINGCFM}
  445.     INLINE $303C, $0A06, $AA53;
  446.     {$ENDC}
  447. FUNCTION GetDictionaryInformation(dictionaryReference: SInt32; VAR theDictionaryInformation: DictionaryInformation): OSErr;
  448.     {$IFC NOT GENERATINGCFM}
  449.     INLINE $303C, $0407, $AA53;
  450.     {$ENDC}
  451. FUNCTION CompactDictionary(dictionaryReference: SInt32): OSErr;
  452.     {$IFC NOT GENERATINGCFM}
  453.     INLINE $303C, $0208, $AA53;
  454.     {$ENDC}
  455. {$ENDC}
  456. {$ALIGN RESET}
  457. {$POP}
  458.  
  459. {$SETC UsingIncludes := DictionaryIncludes}
  460.  
  461. {$ENDC} {__DICTIONARY__}
  462.  
  463. {$IFC NOT UsingIncludes}
  464.  END.
  465. {$ENDC}
  466.